package com.hildert.shop.services;

import com.hildert.shop.entities.Good;
import com.hildert.shop.repositories.GoodRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class GoodService {

    private final GoodRepository goodRepository;

    @Autowired
    public GoodService(GoodRepository goodRepository) {
        this.goodRepository = goodRepository;
    }

    public Page<Good> getList(Pageable pageable) {
        return goodRepository.findAll(pageable);
    }
}
